<?php

namespace app\admin\service\statistics\promotion\total;

use app\admin\service\statistics\promotion\AbstractQueryStatistician;
use app\admin\service\statistics\traits\CompletionTrait;
use app\admin\service\statistics\traits\FilterDateTrait;
use app\admin\service\statistics\traits\FilterGroupTrait;
use app\admin\service\statistics\traits\GrouperDateTrait;
use app\common\model\PromotionGroupRoiConsume;

/**
 * 渠道数据 总计 ROI成本
 * Class RoiConsume
 * @package app\admin\service\statistics\promotion\total
 */
class RoiConsume extends AbstractQueryStatistician
{
    // 筛选器
    use FilterGroupTrait;
    use FilterDateTrait;

    // 分组器
    use GrouperDateTrait;

    // 补齐
    use CompletionTrait;

    protected function getQuery()
    {
        return PromotionGroupRoiConsume::field(['sum(value)' => 'value']);
    }

    protected function getDefaultValue()
    {
        return '0';
    }
}